package com.yudean.erp.controller;


import com.yudean.erp.service.IIdsPmProTechService;
import com.yudean.erp.util.XmlUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 沈泽群
 * @since 2021-06-15
 */
@RestController
@RequestMapping("/ids-pm-pro-tech")
public class IdsPmProTechController {
    @Autowired
    IIdsPmProTechService idsPmProTechService;

    /**
     * 将传递进来的参数封装成Map
     * @param thchProjectCode 项目编号
     * @return XML String
     */
    @ApiOperation(value = "根据项目编号获取生产项目记录",notes = "根据项目编号获取生产项目记录的接口")
    @GetMapping("")
    public String findXmlByProjectCode(@RequestParam(value = "TECHPROJECTCODE") String thchProjectCode){
        HashMap<String,Object> map = new HashMap<>();
        map.put("TECHPROJECTCODE",thchProjectCode);
        return XmlUtil.bean2Xml(idsPmProTechService.findByMultiCondition(map));
    }
}
